#include "pixitem.h"

PixItem::PixItem(QPixmap *pix)
{
    pixmap=*pix;
}



QRectF PixItem::boundingRect()const
{
    return QRectF(-2-pixmap.width()/2,-2-pixmap.height()/2,pixmap.width()+4,pixmap.height()+4);
}
void PixItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
    painter->drawPixmap(-pixmap.width()/2,-pixmap.height()/2,pixmap);
}
